﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace iSlideTools.LocalServer.Models
{
    public class RegisterViewModel
    {
        [DisplayName("用户名")]
        [Required(ErrorMessage = "用户名不能为空！")]
        public string UserName { get; set; }

        [DisplayName("密码")]
        [Required(ErrorMessage = "密码不能为空！")]
        [MinLength(6, ErrorMessage = "密码长度最少是6位！")]
        [DataType(DataType.Password)]
        public string Password { get; set; }

        [DisplayName("确认密码")]
        [DataType(DataType.Password)]
        [Compare("Password", ErrorMessage = "两次输入的密码不一致！")]
        public string ConfirmPassword { get; set; }

        [DisplayName("邮箱")]
        [Required(ErrorMessage = "邮箱不能为空！")]
        [EmailAddress(ErrorMessage = "不是有效的邮箱地址！")]
        public string Email { get; set; }

        [DisplayName("角色")]
        public string Role { get; set; }
    }
}